#ifndef H_minicon_H
#define H_minicon_H

#include "miniwin.h"

namespace Con
{
   void init();
   void setCP( const WCHAR *codepages );

   bool setInp( const WCHAR *fname );
   bool setOut( const WCHAR *fname );
   bool getRawFH( HANDLE &fhi, HANDLE &fho );

   void flush( int what ); // 0x1 - inp, 0x2 - out, 0x4 - err

   bool err( bool err_mode );

   int o( const char  *ps, int nc=-1 );
   int o( const WCHAR *pw, int nw=-1 );
   int o( const char   cc );

   int o( const int      ii );
   int o( const unsigned ui );
   int o( const __int64 iL, int w = 0 );

   int __cdecl f( const char *fmt, ... );
   int __cdecl f( const WCHAR *fmt, ... );

   void n( int n=1 );

   int confirm( const char *question, int def_answer = 'n' );
   // answers{ 'n': no; 'y': yes; 'N': always No; 'Y': always Yes }

   // buffered i/o for files
   int read( WCHAR *buf, int cw );
   int write( const WCHAR *buf, int cw );
}

#endif /* H_minicon_H */
